import { _decorator, Component, Canvas, Node, UITransform } from 'cc';
const { ccclass, property } = _decorator;

import TurkishTetris_GameConfig from "../../../../hall/Data/TurkishTetris_GameConfig";

@ccclass('TurkishTetrisUIManager')
export default class TurkishTetris_UIManager extends Component {
    static Instance: TurkishTetris_UIManager;
    @property(Canvas)
    canvas: Canvas | null = null;
    @property(Node)
    UI_1: Node | null = null;
    @property(Node)
    UI_2: Node | null = null;
    @property(Node)
    UI_3: Node | null = null;
    @property(Node)
    Root_bg: Node | null = null;
    @property(Node)
    Root_grid: Node | null = null;
    @property(Node)
    Root_card: Node | null = null;
    @property(Node)
    Root_effect: Node | null = null;
    @property(Node)
    DeadFrame: Node | null = null;
    @property(Node)
    bgNode: Node | null = null;
    @property(Node)
    effectNode: Node | null = null;
    @property(Node)
    move_bg: Node | null = null;
    onLoad() {
        TurkishTetris_UIManager.Instance = this;

        // for (let index = 0; index < this.node.childrenCount; index++) {
        //     let child = this.node.children[index];
        //     let active: boolean = child.active;
        //     child.active = true;
        //     child.active = active;
        // }
        TurkishTetris_UIManager.AddListener();

        this.move_bg.getComponent(UITransform).height = TurkishTetris_GameConfig.H;
        this.move_bg.active = false;
    }
    static AddListener() { }
}

// /** 调试 */
window["TurkishTetris_UIManager"] = TurkishTetris_UIManager;